projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
564ecdf
)
instance: Warn about unexpected number of parameters
author
Hauke Mehrtens
<
[email protected]
>
Fri, 1 Nov 2019 16:16:39 +0000
(17:16 +0100)
committer
John Crispin
<
[email protected]
>
Sat, 2 Nov 2019 18:31:21 +0000
(19:31 +0100)
Warn when the number of allocated parameters for the jail argv does not
match the number of used parameters. This normally leads to a buffer
overflow.
Signed-off-by: Hauke Mehrtens <
[email protected]
>
service/instance.c
patch
|
blob
|
history
diff --git
a/service/instance.c
b/service/instance.c
index 4bb220751915df5a42178ded7075ec405922a079..3098ff3bb50c478811e480ba774c16e0802dd6b3 100644
(file)
--- a/
service/instance.c
+++ b/
service/instance.c
@@
-337,8
+337,12
@@
instance_run(struct service_instance *in, int _stdout, int _stderr)
ULOG_WARN("Seccomp support for %s::%s not available\n", in->srv->name, in->name);
#endif
- if (in->has_jail)
+ if (in->has_jail)
{
argc = jail_run(in, argv);
+ if (argc != in->jail.argc)
+ ULOG_WARN("expected %i jail params, used %i for %s::%s\n",
+ in->jail.argc, argc, in->srv->name, in->name);
+ }
blobmsg_for_each_attr(cur, in->command, rem)
argv[argc++] = blobmsg_data(cur);